import type {OrderState, ProductLevel, ProductType} from './api';

export interface IProduct {
    id: number;
    title: string;
    cover_img: string;
    old_amount: number;
    amount: number;
    summary: string;
    detail: string;
    uv: number;
    buy_num: number;
    teacher_id: number;
    teacher: ITeacher;
    product_type: ProductType;
    total_point: number;
    content_point: number;
    easy_point: number;
    logic_point: number;
    course_level: ProductLevel;
    hour: number;
    weight: number;
    episode_num: number;
    record_state: string;
    player: string;
    stock: number;
    share: string;
    tdk: string;
    ali_zip_url: string;
    bd_zip_url: string;
    note_url: string;
    gmt_modified: Date;
    gmt_create: Date;
}

export interface ICategory {
    id: number;
    name: string;
    productList: IProduct[];
}

export interface IUser {
    id: number;
    username: string;
    head_img: string;
    slogan: string;
    sex: number;
    city: string;
    role: string;
    learn_time: any;
    vipRank: number;
    coin: number;
    vipExpired: number;
    tag: string;
    position: string;
    company: string;
    appid: string;
    appsecret: string;
    disabled: string;
    phone: string;
    email: string;
    bindWechat: boolean;
    medal: string;
    setPassword: boolean;
    gmtCreate: Date;
    gmtModified: Date;
    acl: {
        callback: string;
        oAUTH_LOGIN: string;
    };
}

export interface ITeacher {
    id: number;
    name: string;
    profile: string;
    headImg: string;
    wechatQrcode: string;
    payQrcode: string;
    point: number;
    remark?: any;
    phone: string;
    online: string;
    gmtCreate: string;
    gmtModified: string;
}

export interface IEpisode {
    id: number;
    free: number;
    title: string;
    ordered: number;
    hwyun_id: string;
    aliyun_id: string;
    chapter_id: number;
    duration: string;
    product_id: number;
    gmt_create: string;
    gmtModified: string;
}

export interface IChapter {
    id: number;
    title: string;
    ordered?: number;
    gmtCreate: string;
    productId: number;
    gmtModified: string;
    episodeList: IEpisode[];
}

export interface IComment {
    id: number;
    content: string;
    account_id: number;
    head_img: string;
    username: string;
    total_point: number;
    content_point: number;
    easy_point: number;
    logic_point: number;
    up: number;
    order_id: number;
    product_id: number;
    learn_time: number;
    gmt_create: Date;
}

export interface IPlayRecord {
    id: number;
    product_id: number;
    current_episode_id: number;
    account_id: number;
    learn_ids: string;
    pay_status: string;
    gmt_modified: string;
    product_title: string;
    cover_img: string;
    episode_num: number;
    product_type: string;
    episode_title: string;
}

export interface IOneToOne {
    duration: number;
    product_detail: string;
    product_id: number;
    product_tdk: string;
    title: string;
    list: IStageItemList[];
    product_summary: string;
}

export interface ISelfStudy {
    title: string;
    list: IStageItemList[];
}

export interface IStageItem {
    id: number;
    productId: number;
    stageId: number;
    itemIndex: number;
    gmtCreate?: Date;
    gmtModified?: Date;
    buyUrl: string;
    title: string;
    coverImg: string;
    level: ProductLevel;
    buyNum: number;
    detail: string;
    oldAmount: number;
    amount: number;
}

export interface IStageItemList {
    id: number;
    stageName: string;
    stageIndex: number;
    studyLineType: string;
    summary: string;
    subTitle: string;
    gmtCreate?: Date;
    gmtModified?: Date;
    stageItemList: IStageItem[];
}

export interface IQuestion {
    id: number;
    title: string;
    content: string;
    accountId: number;
    headImg: string;
    username: string;
    uv: number;
    up: number;
    answerNum: number;
    productTitle?: any;
    episodeTitle: string;
    gmtCreate: string;
    episodeId: number;
    productId: number;
    coin: number;
    weight: number;
    del: number;
    gmtModified: string;
}

export interface IAnswer {
    id: number;
    content: string;
    accountId: number;
    headImg: string;
    username: string;
    uv: number;
    up: number;
    episodeId: number;
    productId: number;
    productTitle?: string;
    episodeTitle?: string;
    questionTitle?: string;
    questionId: number;
    gmtCreate: string;
    gmtModified: string;
    weight: number;
    del: number;
}

export interface IOrder {
    id: number;
    account_id: number;
    username: string;
    user_head_img: string;
    out_trade_no: string;
    order_state: OrderState;
    total_amount: number;
    pay_amount: number;
    product_id: number;
    product_type: string;
    product_title: string;
    product_img: string;
    is_comment: number;
    operator_id: number;
    discount_type: string;
    discount_amount: number;
    del: number;
    gmt_create: Date;
}

export interface IFavorite {
    id: number;
    productId: number;
    title: string;
    coverImg: string;
    accountId: number;
    buyNum: number;
    level: string;
    detail: string;
    uv: number;
    gmtCreate: Date;
    gmtModified?: Date;
}

export interface INote {
    id: number;
    content: string;
    accountId: number;
    headImg: string;
    username: string;
    uv: number;
    up: number;
    del: number;
    episodeId: number;
    productId: number;
    weight: number;
    noteAmount?: number;
    productTitle?: string;
    episodeTitle?: string;
    coverImg?: string;
    productType?: string;
    gmtCreate: string;
    gmtModified: string;
}

export interface IAndroidStore {
    apple_store_url: string;
    default_store_url: string;
}

export interface IAppInfo {
    verIos: string;
    apkName: string;
    appToken: string;
    updateTime: string;
    verAndroid: string;
    androidStore: IAndroidStore;
}

export interface IWechatOrder {
    package: string;
    appid: string;
    sign: string;
    partnerid: string;
    prepayid: string;
    noncestr: string;
    timestamp: string;
}

export interface IwxAppletPay {
    appid: string;
    nonceStr: string;
    package: string;
    partnerid: string;
    paySign: string;
    signType: string;
    timeStamp: string;
}

